// $codepro.audit.disable
/**
 * Test for buyListener
 */
import static org.junit.Assert.*;
import org.junit.Test;


/**
 * @author Master
 * @version $Revision: 1.0 $
 */
public class BuyListenerTest {

	/**
	 * Method toString.
	
	 * @return String */
	@Override
	public String toString() {
		return "BuyListenerTest [toString()=" + super.toString() + "]";
	}

	/**
	 * Method test1.
	 */
	@Test
	public void test1(){
		new GameInfo();
		final BuyListener bl1=new BuyListener(
				new Planet("abc", new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
		final BuyListener bl2=new BuyListener(new Planet("abc",
				new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
		assertNotSame(bl1, bl2);
	}
	
	/**
	 * Method test2.
	 */
	@Test
	public void test2(){
		new GameInfo();
		final BuyListener bl1=new BuyListener(
				new Planet("abc", new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
		final BuyListener bl2=new BuyListener(
				new Planet("abc", new SolarSystem("yan", 150, 250), 350, 450),
				"WATER", new GameInfo());
		assertNotSame(bl1, bl2);
	}
	
	/**
	 * Method test3.
	 */
	@Test
	public void test3(){
		new GameInfo();
		final BuyListener bl1=new BuyListener(
				new Planet("efg", new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
		final BuyListener bl2=new BuyListener(
				new Planet("abc", new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
		assertNotSame(bl1, bl2);
	}
	
	/**
	 * Method test4.
	 */
	@Test
	public void test4(){
		new GameInfo();
		final BuyListener bl=new BuyListener(
				new Planet("efg", new SolarSystem("shu", 100, 200), 300, 400),
				"WATER", new GameInfo());
	    assertTrue(bl.canMatchTechLevel());
	}
	
	/**
	 * Method test5.
	 */
	@Test
	public void test5(){
		new GameInfo();
		final BuyListener bl=new BuyListener(
				new Planet("good", new SolarSystem("bad", 430, 260), 154, 265),
				"RESOURCE", new GameInfo());
	    GoodInfo.init(new Planet("good", new SolarSystem("bad", 430, 260), 154, 265));
		assertTrue(bl.canMatchBudget());
	}
	
	/**
	 * Method test6.
	 */
	@Test
	public void test6(){
		new GameInfo();
		final BuyListener bl=new BuyListener(
				new Planet("good", new SolarSystem("this", 342, 43), 320, 125),
				"ABBB", new GameInfo());
	    assertTrue(bl.canMatchCargo());
	}
    
}
